# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetrics do
  @moduledoc """
  Metrics for classification evaluation results.

  ## Attributes

  *   `auPrc` (*type:* `number()`, *default:* `nil`) - The Area Under Precision-Recall Curve metric. Micro-averaged for the overall evaluation.
  *   `auRoc` (*type:* `number()`, *default:* `nil`) - The Area Under Receiver Operating Characteristic curve metric. Micro-averaged for the overall evaluation.
  *   `confidenceMetrics` (*type:* `list(GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetricsConfidenceMetrics.t)`, *default:* `nil`) - Metrics for each `confidenceThreshold` in 0.00,0.05,0.10,...,0.95,0.96,0.97,0.98,0.99 and `positionThreshold` = INT32_MAX_VALUE. ROC and precision-recall curves, and other aggregated metrics are derived from them. The confidence metrics entries may also be supplied for additional values of `positionThreshold`, but from these no aggregated metrics are computed.
  *   `confusionMatrix` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix.t`, *default:* `nil`) - Confusion matrix of the evaluation.
  *   `logLoss` (*type:* `number()`, *default:* `nil`) - The Log Loss metric.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :auPrc => number() | nil,
          :auRoc => number() | nil,
          :confidenceMetrics =>
            list(
              GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetricsConfidenceMetrics.t()
            )
            | nil,
          :confusionMatrix =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix.t()
            | nil,
          :logLoss => number() | nil
        }

  field(:auPrc)
  field(:auRoc)

  field(:confidenceMetrics,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetricsConfidenceMetrics,
    type: :list
  )

  field(:confusionMatrix,
    as:
      GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsConfusionMatrix
  )

  field(:logLoss)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetrics do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetrics.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1SchemaModelevaluationMetricsClassificationEvaluationMetrics do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
